﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Runtime.InteropServices;
using Word = Microsoft.Office.Interop.Word;
using PresentationControls;
namespace MediaManager
{
    public partial class Manage : Form
    {
        [DllImport("shell32.dll")]
        public static extern int ShellExecute(IntPtr hwnd, String lpszOp, String lpszFile, String lpszParams, String lpszDir, int FsShowCmd);

        private Manage()
        {
            InitializeComponent();
        }
        public Manage(string userName)
        {
            InitializeComponent();
            _userName = userName;
        }
        private string _userName = "";
        private void Manage_Load(object sender, EventArgs e)
        {
            //_dataContext = new DataClasses1DataContext();
            btnAdd_Click(sender, e);
            
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        private void Init()
        {
            //TextBox 
            foreach (Control cPage in this.tabControl1.TabPages)
            {
                int count;
                if (cPage is TabPage)
                {
                    //MessageBox.Show("s");
                    foreach (Control c in cPage.Controls)
                    {
                        if (c is TextBox)
                        {
                            (c as TextBox).Text = "";
                        }
                        else if (c is ComboBox)
                        {
                            if (c is PresentationControls.CheckBoxComboBox)
                            {
                                count = (c as PresentationControls.CheckBoxComboBox).CheckBoxItems.Count;
                                for (int i = 1; i < count; i++)
                                {
                                    (c as PresentationControls.CheckBoxComboBox).CheckBoxItems[i].Checked = false;
                                }
                            }
                            else
                            {
                                (c as ComboBox).SelectedIndex = -1;//测试使用，可以更改为-1
                            }

                        }
                        else if (c is DateTimePicker)
                        {
                            (c as DateTimePicker).Value = DateTime.Now;
                        }
                        else if (c is PictureBox)
                        {
                            (c as PictureBox).Image = null;
                        }
                        else
                        {
                            if (c is GroupBox)
                            {
                                //textBox
                                foreach (Control cc in c.Controls)
                                {
                                    if (cc is TextBox)
                                    {
                                        (cc as TextBox).Text = "";
                                    }
                                    else if (cc is ComboBox)
                                    {
                                        if (cc is PresentationControls.CheckBoxComboBox)
                                        {
                                            count = (cc as PresentationControls.CheckBoxComboBox).CheckBoxItems.Count;
                                            for (int i = 1; i < count; i++)
                                            {
                                                (cc as PresentationControls.CheckBoxComboBox).CheckBoxItems[i].Checked = false;
                                            }
                                        }
                                        else
                                        {
                                            (cc as ComboBox).SelectedIndex = -1; ;//测试使用，可以更改为-1
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            
        }

        public void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                Init();
                _baseTable = new BaseTable();
                 _dongMaiSystem = new DongMaiSystem();
                _jingMaiSystem = new JingMaiSystem();
                _juBu = new JuBu();
                _zhuanKe = new ZhuanKe();
                _baseTable.编号 = 0;
            }
            catch (Exception ex)
            {
                GlobalBase.CatchException.DealWithException(ex);
                GlobalBase.LzlLog.Error(ex.StackTrace);
            }
        }
        private DataClasses1DataContext _dataContext = new DataClasses1DataContext();

        public void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (_baseTable.编号 > 0)
                {
                    UpdateData();
                }
                else
                {
                    InsertData();
                    string s = string.Format(StructDayInfo.添加病例, txtName.Text, DateTime.Now);
                    InserDayInfo(s);
                }
                GlobalBase.Global.Instance.ShowMessage("保存数据成功！");
            }
            catch (Exception ex)
            {
                GlobalBase.CatchException.DealWithException(ex);
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
            }
        }
#region 插入数据
        private void InsertData()
        {
            int id = _dataContext.GetMaxIndex();
            if (id > 0)
            {
                
                BaseTable baseTable = new BaseTable();
                DongMaiSystem dongMaiSystem = new DongMaiSystem();
                JingMaiSystem jingMaiSystem = new JingMaiSystem();
                JuBu juBu = new JuBu();
                ZhuanKe zhuanKe = new ZhuanKe();

                //设置ID
                baseTable.编号 = id;
                dongMaiSystem.id = id;
                jingMaiSystem.id = id;
                juBu.ID = id;
                zhuanKe.id = id;

                //设置插入数据
                SetBaseInfo(baseTable);
                SetDongMaiInfo(dongMaiSystem);
                SetJingMaiInfo(jingMaiSystem);
                SetJuBuInfo(juBu);
                SetZhuanKeInfo(zhuanKe);

                _dataContext.BaseTable.InsertOnSubmit(baseTable);
                _dataContext.DongMaiSystem.InsertOnSubmit(dongMaiSystem);
                _dataContext.JingMaiSystem.InsertOnSubmit(jingMaiSystem);
                _dataContext.JuBu.InsertOnSubmit(juBu);
                _dataContext.ZhuanKe.InsertOnSubmit(zhuanKe);
                _dataContext.SubmitChanges();
            }
            else
            {
                throw new Exception("提取编号失败！");

            }
        }
#endregion
        private void UpdateData()
        {
            BaseTable baseTable = _dataContext.BaseTable.Where(p => p.编号 == _baseTable.编号).Single();
            SetBaseInfo(baseTable);
            DongMaiSystem dongMaiSystem = _dataContext.DongMaiSystem.Where(p => p.id == _baseTable.编号).Single();
            SetDongMaiInfo(dongMaiSystem);
            JingMaiSystem jingMaiSystem = _dataContext.JingMaiSystem.Where(p => p.id == _baseTable.编号).Single();
            SetJingMaiInfo(jingMaiSystem);
            JuBu juBu = _dataContext.JuBu.Where(p => p.ID == _baseTable.编号).Single();
            SetJuBuInfo(juBu);
            ZhuanKe zhuanKe = _dataContext.ZhuanKe.Where(p => p.id == _baseTable.编号).Single();
            SetZhuanKeInfo(zhuanKe);
            _dataContext.SubmitChanges();
        }
        #region save Init
        //基本信息
        private void SetBaseInfo(BaseTable baseTable)
        {
            baseTable.辩证 = txtBianZheng.Text;
            baseTable.出生年月日 = dtChuSheng.Value;
            baseTable.出院时间 = dtChuYuan.Value;
            baseTable.电话 = txtDianHua.Text;
            baseTable.合并症 = txtHeBing.Text;
            baseTable.兼病 = txtJianBing.Text;
            baseTable.日期 = DateTime.Now;
            baseTable.姓名 = txtName.Text;
            baseTable.主治医师 = txtZhuZhiYiShi.Text;
            baseTable.性别 = cboSex.Text;
            baseTable.永久通信地址 = txtTongXin.Text;
            baseTable.邮编 = txtYouBian.Text;
            baseTable.诊断 = txtZhenDuan.Text;
            baseTable.中医病名 = txtBingMing.Text;
            baseTable.主病 = txtZhuBing.Text;
            baseTable.主诉 = txtZhuSu.Text;
            baseTable.住院时间 = dtZhuYuan.Value;
            baseTable.专科检查 = txtZuanKe.Text;
            baseTable.EMAIL = txtEmail.Text;
        }
        //动脉系统
        private void SetDongMaiInfo(DongMaiSystem dongMaiSystem)
        {
            string cboNameIndex = "";
            foreach (Control c in tabControl1.TabPages[1].Controls)
            {
                if (c is ComboBox)
                {
                    if (c is PresentationControls.CheckBoxComboBox)
                    {
                        int count = (c as PresentationControls.CheckBoxComboBox).CheckBoxItems.Count;
                        cboNameIndex += (c as PresentationControls.CheckBoxComboBox).Name;
                        for (int i = 1; i < count; i++)
                        {
                            cboNameIndex += " " + Convert.ToInt32((c as PresentationControls.CheckBoxComboBox).CheckBoxItems[i].Checked).ToString();
                        }
                        cboNameIndex += ",";
                    }
                    else
                    {
                        cboNameIndex += (c as ComboBox).Name + " " + (c as ComboBox).SelectedIndex.ToString().Trim() + ",";
                    }
                }
                
                else if (c is GroupBox)
                {
                    foreach (Control cc in c.Controls)
                    {
                        if (cc is ComboBox)
                        {
                            if (cc is PresentationControls.CheckBoxComboBox)
                            {
                                int count = (cc as PresentationControls.CheckBoxComboBox).CheckBoxItems.Count;
                                cboNameIndex += (cc as PresentationControls.CheckBoxComboBox).Name;
                                for (int i = 1; i < count; i++)
                                {
                                    cboNameIndex += " " + Convert.ToInt32((cc as PresentationControls.CheckBoxComboBox).CheckBoxItems[i].Checked).ToString();
                                }
                                cboNameIndex += ",";
                            }
                            else
                            {
                                cboNameIndex += (cc as ComboBox).Name + " " + (cc as ComboBox).SelectedIndex.ToString().Trim() + ",";
                            }
                        }
                        
                    }
                }
            }
            //去除最后","号
            int cboLen = cboNameIndex.Length;
            if (cboLen > 0)
            {
                cboNameIndex = cboNameIndex.Substring(0, cboLen - 1);
            }
            dongMaiSystem.comboxIndex = cboNameIndex;
            dongMaiSystem.其他情况 = txtQiTa.Text;
            dongMaiSystem.血管杂音 = txtXueGuan.Text;
        }
        //静脉系统
        private void SetJingMaiInfo(JingMaiSystem jingMaiSystem)
        {
            string cboNameIndex = "";
            foreach (Control c in tabControl1.TabPages[2].Controls)
            {
                if (c is ComboBox)
                {
                    if (c is PresentationControls.CheckBoxComboBox)
                    {
                        int count = (c as PresentationControls.CheckBoxComboBox).CheckBoxItems.Count;
                        cboNameIndex += (c as PresentationControls.CheckBoxComboBox).Name;
                        for (int i = 1; i < count; i++)
                        {
                            cboNameIndex += " " + Convert.ToInt32((c as PresentationControls.CheckBoxComboBox).CheckBoxItems[i].Checked).ToString();
                        }
                        cboNameIndex += ",";
                    }
                    else
                    {
                        cboNameIndex += (c as ComboBox).Name + " " + (c as ComboBox).SelectedIndex.ToString().Trim() + ",";
                    }
                }
                
            }
            //去除最后","号
            int cboLen = cboNameIndex.Length;
            if (cboLen > 0)
            {
                cboNameIndex = cboNameIndex.Substring(0, cboLen - 1);
            }
            jingMaiSystem.ComboxIndex = cboNameIndex;
            jingMaiSystem.关节 = txtGuanJie.Text;
            jingMaiSystem.淋巴 = txtLinBa.Text;
            jingMaiSystem.其它情况 = txtQingKuang.Text;
            jingMaiSystem.其它系统 = txtXiTong.Text;
            jingMaiSystem.下肢近右 = txtJinYou.Text;
            jingMaiSystem.下肢近左 = txtJinZuo.Text;
            jingMaiSystem.下肢远右 = txtYuanYou.Text;
            jingMaiSystem.下肢远左 = txtYuanZuo.Text;
        }
        //局部合并症
        private void SetJuBuInfo(JuBu juBu)
        {
            string cboNameIndex = "";
            foreach (Control c in tabControl1.TabPages[3].Controls)
            {
                if (c is ComboBox)
                {
                    if (c is PresentationControls.CheckBoxComboBox)
                    {
                        int count = (c as PresentationControls.CheckBoxComboBox).CheckBoxItems.Count;
                        cboNameIndex += (c as PresentationControls.CheckBoxComboBox).Name;
                        for (int i = 1; i < count; i++)
                        {
                            cboNameIndex += " " + Convert.ToInt32((c as PresentationControls.CheckBoxComboBox).CheckBoxItems[i].Checked).ToString();
                        }
                        cboNameIndex += ",";
                    }
                    else
                    {
                        cboNameIndex += (c as ComboBox).Name + " " + (c as ComboBox).SelectedIndex.ToString().Trim() + ",";
                    }
                }
                
            }
            //去除最后","号
            int cboLen = cboNameIndex.Length;
            if (cboLen > 0)
            {
                cboNameIndex = cboNameIndex.Substring(0, cboLen - 1);
            }
            juBu.ComboxIndex = cboNameIndex;
            juBu.部位 = textBox24.Text;
            juBu.面积 = textBox25.Text;
            juBu.其他情况 = txtJuBuQingKuan.Text;
        }
        //专科检查
        private void SetZhuanKeInfo(ZhuanKe zhuanKe)
        {
            //图片
            zhuanKe.ABI图片 = _zhuanKe.ABI图片;
            zhuanKe.ABI图片1 = _zhuanKe.ABI图片1;
            zhuanKe.ABI图片2 = _zhuanKe.ABI图片2;
            zhuanKe.ABI图片3 = _zhuanKe.ABI图片3;
            zhuanKe.ABI图片4 = _zhuanKe.ABI图片4;
            zhuanKe.ABI图片5 = _zhuanKe.ABI图片5;
            zhuanKe.ABI图片6 = _zhuanKe.ABI图片6;
            zhuanKe.ABI图片7 = _zhuanKe.ABI图片7;

            zhuanKe.病情图片 = _zhuanKe.病情图片;
            zhuanKe.病情图片1 = _zhuanKe.病情图片1;
            zhuanKe.病情图片2 = _zhuanKe.病情图片2;
            zhuanKe.病情图片3 = _zhuanKe.病情图片3;
            zhuanKe.病情图片4 = _zhuanKe.病情图片4;
            zhuanKe.病情图片5 = _zhuanKe.病情图片5;
            zhuanKe.病情图片6 = _zhuanKe.病情图片6;
            zhuanKe.病情图片7 = _zhuanKe.病情图片7;
            zhuanKe.病情图片8 = _zhuanKe.病情图片8;
            zhuanKe.病情图片9 = _zhuanKe.病情图片9;
            zhuanKe.病情图片10 = _zhuanKe.病情图片10;
            zhuanKe.病情图片11 = _zhuanKe.病情图片11;

            zhuanKe.造影图片 = _zhuanKe.造影图片;
            zhuanKe.造影图片1 = _zhuanKe.造影图片1;
            zhuanKe.造影图片2 = _zhuanKe.造影图片2;
            zhuanKe.造影图片3 = _zhuanKe.造影图片3;
            zhuanKe.造影图片4 = _zhuanKe.造影图片4;
            zhuanKe.造影图片5 = _zhuanKe.造影图片5;
            zhuanKe.造影图片6 = _zhuanKe.造影图片6;
            zhuanKe.造影图片7 = _zhuanKe.造影图片7;
            zhuanKe.造影图片8 = _zhuanKe.造影图片8;
            zhuanKe.造影图片9 = _zhuanKe.造影图片9;
            zhuanKe.造影图片10 = _zhuanKe.造影图片10;
            zhuanKe.造影图片11 = _zhuanKe.造影图片11;

            //信息
            zhuanKe.ABI右 = txtABIYou.Text;
            zhuanKe.ABI左 = txtABIZuo.Text;
            zhuanKe.病情 = cboBingQingTu.SelectedIndex;
            zhuanKe.病情1 = this.comboBox101.SelectedIndex;
            zhuanKe.病情2 = this.comboBox102.SelectedIndex;
            zhuanKe.其它 = txtXueGuanQiTa.Text;
            zhuanKe.手术名称 = txtShouShu.Text;
            zhuanKe.随访记录 = txtSuiFang.Text;
            zhuanKe.血管造影 = cboXueGuan.SelectedIndex;
            zhuanKe.血管造影1 = comboBox99.SelectedIndex;
            zhuanKe.血管造影2 = comboBox100.SelectedIndex;
            zhuanKe.造影号码 = txtZaoYingHaoMa.Text;
            zhuanKe.造影日期 = dtXueGuanRiQi.Value;
            zhuanKe.治疗方式 = cboZhiLiao.SelectedIndex;

        }
        #endregion
        private BaseTable _baseTable = new BaseTable();
        private DongMaiSystem _dongMaiSystem = new DongMaiSystem();
        private JingMaiSystem _jingMaiSystem = new JingMaiSystem();
        private JuBu _juBu = new JuBu();
        private ZhuanKe _zhuanKe = new ZhuanKe();

        private void in1_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.ABI图片 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.ABI图片.ToArray());
                    ABIPic.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void in2_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.造影图片 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.造影图片.ToArray());
                    picXueGuan.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void in3_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.病情图片 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.病情图片.ToArray());
                    picBingQing.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void open1_Click(object sender, EventArgs e)
        {
            ShowPic(ABIPic.Image);
        }

        private void open2_Click(object sender, EventArgs e)
        {
            ShowPic(picXueGuan.Image);
        }

        private void open3_Click(object sender, EventArgs e)
        {
            ShowPic(picBingQing.Image);
        }
        private void ShowPic(Image image)
        {
            if (null == image)
            {
                GlobalBase.Global.Instance.ShowMessage("请先导入图片！");
                return;
            }
            _picFrm = new Picture();
            _picFrm.SetPic(image);
            _picFrm.Show();
            _picFrm.Activate();
        }
        private Picture _picFrm;

        public void btnSearch_Click(object sender, EventArgs e)
        {
            _searchManage = new SearchManage(_userName);
            _searchManage.onUpdateData += new UpdateData(UpdateMediaData);
            _searchManage.ShowDialog();
        }
        public void UpdateMediaData(int id)
        {
            BaseTable baseTable = _dataContext.BaseTable.Where(p => p.编号 == id).Single();
            UpdateBaseInfo(baseTable);
            DongMaiSystem dongMaiSystem = _dataContext.DongMaiSystem.Where(p => p.id == id).Single();
            UpdateDongMaiInfo(dongMaiSystem);
            JingMaiSystem jingMaiSystem = _dataContext.JingMaiSystem.Where(p => p.id == id).Single();
            UpdateJingMaiInfo(jingMaiSystem);
            JuBu juBu = _dataContext.JuBu.Where(p => p.ID == id).Single();
            UpdateJuBuInfo(juBu);
            ZhuanKe zhuanKe = _dataContext.ZhuanKe.Where(p => p.id == id).Single();
            UpdateZhuanKeInfo(zhuanKe);
            _baseTable.编号 = id;
        }
        #region 更新
        //基本信息
        private void UpdateBaseInfo(BaseTable baseTable)
        {
            txtBianZheng.Text = baseTable.辩证;
            dtChuSheng.Value = Convert.ToDateTime(baseTable.出生年月日);
            dtChuYuan.Value = Convert.ToDateTime( baseTable.出院时间);
            txtDianHua.Text = baseTable.电话;
            txtHeBing.Text = baseTable.合并症;
            txtJianBing.Text = baseTable.兼病;
            txtName.Text = baseTable.姓名;
            txtZhuZhiYiShi.Text = baseTable.主治医师;
            cboSex.Text = baseTable.性别;
            txtTongXin.Text = baseTable.永久通信地址;
            txtYouBian.Text = baseTable.邮编;
            txtZhenDuan.Text = baseTable.诊断;
            txtBingMing.Text = baseTable.中医病名;
            txtZhuBing.Text = baseTable.主病;
            txtZhuSu.Text = baseTable.主诉;
            dtZhuYuan.Value = Convert.ToDateTime( baseTable.住院时间);
            txtZuanKe.Text = baseTable.专科检查;
            txtEmail.Text = baseTable.EMAIL;
        }
        //动脉系统
        private void UpdateDongMaiInfo(DongMaiSystem dongMaiSystem)
        {
            string cboNameIndex = dongMaiSystem.comboxIndex;
            string[] cboNameSelectIndex = cboNameIndex.Split(',');
            string[] ss = null;
            int count;
            foreach (Control c in tabControl1.TabPages[1].Controls)
            {
                if (c is ComboBox)
                {
                    if (c is PresentationControls.CheckBoxComboBox)
                    {
                        foreach (string s in cboNameSelectIndex)
                        {
                            ss = s.Split(' ');
                            if ((c as PresentationControls.CheckBoxComboBox).Name == ss[0])
                            {
                                count = ss.Length;
                                for (int i = 1; i < count; i++)
                                {
                                    (c as PresentationControls.CheckBoxComboBox).CheckBoxItems[i].Checked = Convert.ToBoolean(Convert.ToInt32(ss[i]));
                                }
                                break;
                            }
                        }
                    }
                    else
                    {
                        foreach (string s in cboNameSelectIndex)
                        {
                            ss = s.Split(' ');
                            if ((c as ComboBox).Name == ss[0])
                            {
                                (c as ComboBox).SelectedIndex = Convert.ToInt32(ss[1]);
                                break;
                            }
                        }
                    }
                }
                
                else if (c is GroupBox)
                {
                    foreach (Control cc in c.Controls)
                    {
                        if (cc is ComboBox)
                        {
                            if (cc is PresentationControls.CheckBoxComboBox)
                            {
                                foreach (string s in cboNameSelectIndex)
                                {
                                    ss = s.Split(' ');
                                    if ((cc as PresentationControls.CheckBoxComboBox).Name == ss[0])
                                    {
                                        count = ss.Length;
                                        for (int i = 1; i < count; i++)
                                        {
                                            (cc as PresentationControls.CheckBoxComboBox).CheckBoxItems[i].Checked = Convert.ToBoolean(Convert.ToInt32(ss[i]));
                                        }
                                        break;
                                    }
                                }
                            }
                            else
                            {
                                foreach (string s in cboNameSelectIndex)
                                {
                                    ss = s.Split(' ');
                                    if ((cc as ComboBox).Name == ss[0])
                                    {
                                        (cc as ComboBox).SelectedIndex = Convert.ToInt32(ss[1]);
                                        break;
                                    }
                                }
                            }
                        }
                        
                    }
                }
            }
           txtQiTa.Text  = dongMaiSystem.其他情况;
           txtXueGuan.Text  = dongMaiSystem.血管杂音;
        }
        //静脉系统
        private void UpdateJingMaiInfo(JingMaiSystem jingMaiSystem)
        {
            string cboNameIndex = jingMaiSystem.ComboxIndex;
            string[] cboNameSelectIndex = cboNameIndex.Split(',');
            string[] ss = null;
            int count;
            foreach (Control c in tabControl1.TabPages[2].Controls)
            {
                if (c is ComboBox)
                {
                    if (c is PresentationControls.CheckBoxComboBox)
                    {
                        foreach (string s in cboNameSelectIndex)
                        {
                            ss = s.Split(' ');
                            if ((c as PresentationControls.CheckBoxComboBox).Name == ss[0])
                            {
                                count = ss.Length;
                                for (int i = 1; i < count; i++)
                                {
                                    (c as PresentationControls.CheckBoxComboBox).CheckBoxItems[i].Checked = Convert.ToBoolean(Convert.ToInt32(ss[i]));
                                }
                                break;
                            }
                        }
                    }
                    else
                    {
                        foreach (string s in cboNameSelectIndex)
                        {
                            ss = s.Split(' ');
                            if ((c as ComboBox).Name == ss[0])
                            {
                                (c as ComboBox).SelectedIndex = Convert.ToInt32(ss[1]);
                                break;
                            }
                        }
                    }
                }
                
            }
            txtGuanJie.Text = jingMaiSystem.关节;
            txtLinBa.Text = jingMaiSystem.淋巴;
            txtQingKuang.Text = jingMaiSystem.其它情况;
            txtXiTong.Text = jingMaiSystem.其它系统;
            txtJinYou.Text = jingMaiSystem.下肢近右;
            txtJinZuo.Text = jingMaiSystem.下肢近左;
            txtYuanYou.Text = jingMaiSystem.下肢远右;
            txtYuanZuo.Text = jingMaiSystem.下肢远左;
        }
        //局部合并症
        private void UpdateJuBuInfo(JuBu juBu)
        {
            string cboNameIndex = juBu.ComboxIndex;
            string[] cboNameSelectIndex = cboNameIndex.Split(',');
            string[] ss = null;
            int count;
            foreach (Control c in tabControl1.TabPages[3].Controls)
            {
                if (c is ComboBox)
                {
                    if (c is PresentationControls.CheckBoxComboBox)
                    {
                        foreach (string s in cboNameSelectIndex)
                        {
                            ss = s.Split(' ');
                            if ((c as PresentationControls.CheckBoxComboBox).Name == ss[0])
                            {
                                count = ss.Length;
                                for (int i = 1; i < count; i++)
                                {
                                    (c as PresentationControls.CheckBoxComboBox).CheckBoxItems[i].Checked = Convert.ToBoolean(Convert.ToInt32(ss[i]));
                                }
                                break;
                            }
                        }
                    }
                    else
                    {
                        foreach (string s in cboNameSelectIndex)
                        {
                            ss = s.Split(' ');
                            if ((c as ComboBox).Name == ss[0])
                            {
                                (c as ComboBox).SelectedIndex = Convert.ToInt32(ss[1]);
                                break;
                            }
                        }
                    }
                }
                
            }
            textBox24.Text = juBu.部位;
            textBox25.Text = juBu.面积;
            txtJuBuQingKuan.Text = juBu.其他情况;
        }
        //专科检查
        private void UpdateZhuanKeInfo(ZhuanKe zhuanKe)
        {
            Stream stream;
            //图片
            if (null != zhuanKe.ABI图片)
            {
                stream = new MemoryStream(zhuanKe.ABI图片.ToArray());
                ABIPic.Image = Image.FromStream(stream);
            }
            else
            {
                ABIPic.Image = null;
            }
            _zhuanKe.ABI图片 = zhuanKe.ABI图片;
            if (null != zhuanKe.ABI图片1)
            {
                stream = new MemoryStream(zhuanKe.ABI图片1.ToArray());
                this.pictureBox7.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox7.Image = null;
            }
            _zhuanKe.ABI图片1 = zhuanKe.ABI图片1;
            if (null != zhuanKe.ABI图片2)
            {
                stream = new MemoryStream(zhuanKe.ABI图片2.ToArray());
                this.pictureBox8.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox8.Image = null;
            }
            _zhuanKe.ABI图片2 = zhuanKe.ABI图片2;
            if (null != zhuanKe.ABI图片3)
            {
                stream = new MemoryStream(zhuanKe.ABI图片3.ToArray());
                this.pictureBox10.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox10.Image = null;
            }
            _zhuanKe.ABI图片3 = zhuanKe.ABI图片3;
            if (null != zhuanKe.ABI图片4)
            {
                stream = new MemoryStream(zhuanKe.ABI图片4.ToArray());
                this.pictureBox14.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox14.Image = null;
            }
            _zhuanKe.ABI图片4 = zhuanKe.ABI图片4;
            if (null != zhuanKe.ABI图片5)
            {
                stream = new MemoryStream(zhuanKe.ABI图片5.ToArray());
                this.pictureBox15.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox15.Image = null;
            }
            _zhuanKe.ABI图片5 = zhuanKe.ABI图片5;
            if (null != zhuanKe.ABI图片6)
            {
                stream = new MemoryStream(zhuanKe.ABI图片6.ToArray());
                this.pictureBox16.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox16.Image = null;
            }
            _zhuanKe.ABI图片6 = zhuanKe.ABI图片6;
            if (null != zhuanKe.ABI图片7)
            {
                stream = new MemoryStream(zhuanKe.ABI图片7.ToArray());
                this.pictureBox17.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox17.Image = null;
            }
            _zhuanKe.ABI图片7 = zhuanKe.ABI图片7;
            if (null != zhuanKe.病情图片)
            {
                stream = new MemoryStream(zhuanKe.病情图片.ToArray());
                picBingQing.Image = Image.FromStream(stream);
            }
            else
            {
                picBingQing.Image = null;
            }
            _zhuanKe.病情图片 = zhuanKe.病情图片;
            if (null != zhuanKe.病情图片1)
            {
                stream = new MemoryStream(zhuanKe.病情图片1.ToArray());
                this.pictureBox5.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox5.Image = null;
            }
            _zhuanKe.病情图片1 = zhuanKe.病情图片1;
            if (null != zhuanKe.病情图片2)
            {
                stream = new MemoryStream(zhuanKe.病情图片2.ToArray());
                this.pictureBox6.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox6.Image = null;
            }
            _zhuanKe.病情图片2 = zhuanKe.病情图片2;
            if (null != zhuanKe.病情图片3)
            {
                stream = new MemoryStream(zhuanKe.病情图片3.ToArray());
                this.pictureBox9.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox9.Image = null;
            }
            _zhuanKe.病情图片3 = zhuanKe.病情图片3;
            if (null != zhuanKe.病情图片4)
            {
                stream = new MemoryStream(zhuanKe.病情图片4.ToArray());
                this.pictureBox19.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox19.Image = null;
            }
            _zhuanKe.病情图片4 = zhuanKe.病情图片4;
            if (null != zhuanKe.病情图片5)
            {
                stream = new MemoryStream(zhuanKe.病情图片5.ToArray());
                this.pictureBox20.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox20.Image = null;
            }
            _zhuanKe.病情图片5 = zhuanKe.病情图片5;
            if (null != zhuanKe.病情图片6)
            {
                stream = new MemoryStream(zhuanKe.病情图片6.ToArray());
                this.pictureBox21.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox21.Image = null;
            }
            _zhuanKe.病情图片6 = zhuanKe.病情图片6;
            if (null != zhuanKe.病情图片7)
            {
                stream = new MemoryStream(zhuanKe.病情图片7.ToArray());
                this.pictureBox22.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox22.Image = null;
            }
            _zhuanKe.病情图片7 = zhuanKe.病情图片7;
            if (null != zhuanKe.病情图片8)
            {
                stream = new MemoryStream(zhuanKe.病情图片8.ToArray());
                this.pictureBox23.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox23.Image = null;
            }
            _zhuanKe.病情图片8 = zhuanKe.病情图片8;
            if (null != zhuanKe.病情图片9)
            {
                stream = new MemoryStream(zhuanKe.病情图片9.ToArray());
                this.pictureBox24.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox24.Image = null;
            }
            _zhuanKe.病情图片9 = zhuanKe.病情图片9;
            if (null != zhuanKe.病情图片10)
            {
                stream = new MemoryStream(zhuanKe.病情图片10.ToArray());
                this.pictureBox25.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox25.Image = null;
            }
            _zhuanKe.病情图片10 = zhuanKe.病情图片10;
            if (null != zhuanKe.病情图片11)
            {
                stream = new MemoryStream(zhuanKe.病情图片11.ToArray());
                this.pictureBox26.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox26.Image = null;
            }
            _zhuanKe.病情图片11 = zhuanKe.病情图片11;
            if (null != zhuanKe.造影图片)
            {
                stream = new MemoryStream(zhuanKe.造影图片.ToArray());
                picXueGuan.Image = Image.FromStream(stream);
            }
            else
            {
                picXueGuan.Image = null;
            }
            _zhuanKe.造影图片 = zhuanKe.造影图片;

            if (null != zhuanKe.造影图片1)
            {
                stream = new MemoryStream(zhuanKe.造影图片1.ToArray());
                this.pictureBox1.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox1.Image = null;
            }
            _zhuanKe.造影图片1 = zhuanKe.造影图片1;

            if (null != zhuanKe.造影图片2)
            {
                stream = new MemoryStream(zhuanKe.造影图片2.ToArray());
                this.pictureBox2.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox2.Image = null;
            }
            _zhuanKe.造影图片2 = zhuanKe.造影图片2;

            if (null != zhuanKe.造影图片3)
            {
                stream = new MemoryStream(zhuanKe.造影图片3.ToArray());
                this.pictureBox3.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox3.Image = null;
            }
            _zhuanKe.造影图片3 = zhuanKe.造影图片3;

            if (null != zhuanKe.造影图片4)
            {
                stream = new MemoryStream(zhuanKe.造影图片4.ToArray());
                this.pictureBox4.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox4.Image = null;
            }
            _zhuanKe.造影图片4 = zhuanKe.造影图片4;
            if (null != zhuanKe.造影图片4)
            {
                stream = new MemoryStream(zhuanKe.造影图片4.ToArray());
                this.pictureBox4.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox4.Image = null;
            }
            _zhuanKe.造影图片4 = zhuanKe.造影图片4; 
            if (null != zhuanKe.造影图片5)
            {
                stream = new MemoryStream(zhuanKe.造影图片5.ToArray());
                this.pictureBox11.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox11.Image = null;
            }
            _zhuanKe.造影图片5 = zhuanKe.造影图片5;
            if (null != zhuanKe.造影图片6)
            {
                stream = new MemoryStream(zhuanKe.造影图片6.ToArray());
                this.pictureBox12.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox12.Image = null;
            }
            _zhuanKe.造影图片6 = zhuanKe.造影图片6;
            if (null != zhuanKe.造影图片7)
            {
                stream = new MemoryStream(zhuanKe.造影图片7.ToArray());
                this.pictureBox13.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox13.Image = null;
            }
            _zhuanKe.造影图片7 = zhuanKe.造影图片7;
            if (null != zhuanKe.造影图片8)
            {
                stream = new MemoryStream(zhuanKe.造影图片8.ToArray());
                this.pictureBox27.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox27.Image = null;
            }
            _zhuanKe.造影图片8 = zhuanKe.造影图片8;
            if (null != zhuanKe.造影图片9)
            {
                stream = new MemoryStream(zhuanKe.造影图片9.ToArray());
                this.pictureBox18.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox18.Image = null;
            }
            _zhuanKe.造影图片9 = zhuanKe.造影图片9;
            if (null != zhuanKe.造影图片10)
            {
                stream = new MemoryStream(zhuanKe.造影图片10.ToArray());
                this.pictureBox28.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox28.Image = null;
            }
            _zhuanKe.造影图片10 = zhuanKe.造影图片10;
            if (null != zhuanKe.造影图片11)
            {
                stream = new MemoryStream(zhuanKe.造影图片11.ToArray());
                this.pictureBox29.Image = Image.FromStream(stream);
            }
            else
            {
                this.pictureBox29.Image = null;
            }
            _zhuanKe.造影图片11 = zhuanKe.造影图片11;
            //信息
            txtABIYou.Text = zhuanKe.ABI右;
            txtABIZuo.Text = zhuanKe.ABI左;
            cboBingQingTu.SelectedIndex = Convert.ToInt32( zhuanKe.病情);
            comboBox101.SelectedIndex = Convert.ToInt32(zhuanKe.病情1);
            comboBox102.SelectedIndex = Convert.ToInt32(zhuanKe.病情2);
            txtXueGuanQiTa.Text = zhuanKe.其它;
            txtShouShu.Text = zhuanKe.手术名称;
            txtSuiFang.Text = zhuanKe.随访记录;
            cboXueGuan.SelectedIndex = Convert.ToInt32( zhuanKe.血管造影);
            comboBox99.SelectedIndex = Convert.ToInt32(zhuanKe.血管造影1);
            comboBox100.SelectedIndex = Convert.ToInt32(zhuanKe.血管造影2);
            txtZaoYingHaoMa.Text = zhuanKe.造影号码;
            dtXueGuanRiQi.Value = Convert.ToDateTime( zhuanKe.造影日期);
            cboZhiLiao.SelectedIndex = Convert.ToInt32( zhuanKe.治疗方式);
        }
        #endregion
        private void InserDayInfo(string dInfo)
        {
            DataClasses2DataContext dataContext = new DataClasses2DataContext();
            DayInfo dayInfo = new DayInfo();
            dayInfo.id = dataContext.GetDayInfoIndex();
            dayInfo.name = _userName;
            dayInfo.操作 = dInfo;
            dayInfo.日期 = DateTime.Now;
            dataContext.DayInfo.InsertOnSubmit(dayInfo);
            dataContext.SubmitChanges();

        }
        public void Print()
        {
            object missing = System.Reflection.Missing.Value;
            Word._Application oWord = new Word.Application();
            oWord.Visible = true;
            Word._Document oDoc = oWord.Documents.Add(ref missing, ref missing, ref missing, ref missing);
            oWord.Selection.Font.Size = 16;
            OutMingCheng(oWord, "  河南中医学院第一附属医院周围血管科住院病历采集表\n");
            oWord.Selection.Font.Size = 10;
            string path = AppDomain.CurrentDomain.BaseDirectory + "\\doc";
            if (!System.IO.Directory.Exists(path))
            {
                System.IO.Directory.CreateDirectory(path);
            }
            DateTime dt = DateTime.Now;
            string fileqianming = _userName + dt.Year.ToString().Trim() + dt.Month.ToString().Trim() +
                dt.Day.ToString().Trim() + dt.Hour.ToString().Trim() + dt.Minute.ToString().Trim() +
                dt.Second.ToString().Trim() + dt.Millisecond.ToString().Trim();
            object docFile = path + "\\" + fileqianming + ".doc";
            string jpgFile1 = path + "\\" + fileqianming + "ABI" + ".jpg";
            string jpgFile2 = path + "\\" + fileqianming + "ZY" + ".jpg";
            string jpgFile3 = path + "\\" + fileqianming + "BQ" + ".jpg";
            //第一页
            //姓名
            OutMingCheng(oWord, "姓名：");
            OutMingChengValue(oWord, txtName.Text);
            //性别
            OutMingCheng(oWord, "   性别：");
            OutMingChengValue(oWord, cboSex.Text);
            //出生
            OutMingCheng(oWord, "  出生年月日：");
            OutMingChengValue(oWord, dtChuSheng.Value.ToShortDateString());
            //通信
            OutMingCheng(oWord,"\n" + "永久通信地址：");
            OutMingChengValue(oWord, txtTongXin.Text);
            //邮编
            OutMingCheng(oWord, "      邮编：");
            OutMingChengValue(oWord, txtYouBian.Text);

            OutMingCheng(oWord, "\n电话：");
            OutMingChengValue(oWord, this.txtDianHua.Text);
            OutMingCheng(oWord, "       E－mail");
            OutMingChengValue(oWord, this.txtEmail.Text);

            OutMingCheng(oWord, "\n住院时间：");
            OutMingChengValue(oWord, this.dtZhuYuan.Value.ToShortDateString());
            OutMingCheng(oWord, "       出院时间：");
            OutMingChengValue(oWord, this.dtChuYuan.Value.ToShortDateString());

            OutMingCheng(oWord, "\n主诉：");
            OutMingChengValue(oWord, this.txtZhuSu.Text);

            OutMingCheng(oWord, "\n诊断：");
            OutMingChengValue(oWord, this.txtZhenDuan.Text);

            OutMingCheng(oWord, "\n中医病名：");
            OutMingChengValue(oWord, this.txtBingMing.Text);

            OutMingCheng(oWord, "\n辨证：");
            OutMingChengValue(oWord, this.txtBianZheng.Text);

            OutMingCheng(oWord, "\n西医诊断：主病：");
            OutMingChengValue(oWord, this.txtZhuBing.Text);

            OutMingCheng(oWord, "\n          合并症：");
            OutMingChengValue(oWord, this.txtHeBing.Text);

            OutMingCheng(oWord, "\n          兼病：");
            OutMingChengValue(oWord, this.txtJianBing.Text);

            OutMingCheng(oWord, "\n专科检查：");
            OutMingChengValue(oWord, this.txtZuanKe.Text);

            OutMingCheng(oWord, "\n主治医师：");
            OutMingChengValue(oWord, this.txtZhuZhiYiShi.Text);

            //第二页
            OutMingCheng(oWord, "\n动脉系统：");
            OutMingCheng(oWord, "\n1、苍白：");
            OutMingChengValue(oWord, this.comboBox2.Text);
            OutMingChengValue(oWord, this.comboBox3.Text);
            OutMingCheng(oWord, "上肢：");
            OutMingChengValue(oWord, this.comboBox4.Text);
            OutMingChengValue(oWord, this.comboBox5.Text);
            OutMingCheng(oWord, "下肢：");
            OutMingChengValue(oWord, this.comboBox6.Text);

            OutMingCheng(oWord, "\n2、紫绀");
            OutMingChengValue(oWord, this.comboBox7.Text);
            OutMingChengValue(oWord, this.comboBox8.Text);
            OutMingCheng(oWord, "上肢：");
            OutMingChengValue(oWord, this.comboBox9.Text);
            OutMingChengValue(oWord, this.comboBox10.Text);
            OutMingCheng(oWord, "下肢：");
            OutMingChengValue(oWord, this.comboBox11.Text);

            OutMingCheng(oWord, "\n3、潮红");
            OutMingChengValue(oWord, this.comboBox12.Text);
            OutMingChengValue(oWord, this.comboBox13.Text);
            OutMingCheng(oWord, "上肢：");
            OutMingChengValue(oWord, this.comboBox14.Text);
            OutMingChengValue(oWord, this.comboBox15.Text);
            OutMingCheng(oWord, "下肢：");
            OutMingChengValue(oWord, this.comboBox16.Text);

            OutMingCheng(oWord, "\n4、皮温低");
            OutMingChengValue(oWord, this.comboBox17.Text);
            OutMingChengValue(oWord, this.comboBox18.Text);
            OutMingCheng(oWord, "上肢：");
            OutMingChengValue(oWord, this.comboBox19.Text);
            OutMingChengValue(oWord, this.comboBox20.Text);
            OutMingCheng(oWord, "下肢：");
            OutMingChengValue(oWord, this.comboBox21.Text);

            OutMingCheng(oWord, "\n5、肿胀");
            OutMingChengValue(oWord, this.comboBox22.Text);
            OutMingChengValue(oWord, this.comboBox23.Text);
            OutMingCheng(oWord, "上肢：");
            OutMingChengValue(oWord, this.comboBox24.Text);
            OutMingChengValue(oWord, this.comboBox25.Text);
            OutMingCheng(oWord, "下肢：");
            OutMingChengValue(oWord, this.comboBox26.Text);

            OutMingCheng(oWord, "\n6、指（趾）甲状况：");
            OutMingChengValue(oWord, this.comboBox27.Text);

            OutMingCheng(oWord, "\n7、汗毛：");
            OutMingChengValue(oWord, this.comboBox28.Text);

            OutMingCheng(oWord, "\n8、皮肤：");
            OutMingChengValue(oWord, this.comboBox29.Text);

            OutMingCheng(oWord, "\n9、浅表静脉：");
            OutMingChengValue(oWord, this.comboBox30.Text);

            OutMingCheng(oWord, "\n10、贝格氏征：");
            OutMingChengValue(oWord, this.comboBox31.Text);
            OutMingChengValue(oWord, this.comboBox32.Text);
            OutMingCheng(oWord, "阳性：");
            OutMingChengValue(oWord, this.comboBox34.Text);
            OutMingCheng(oWord, "强阳性：");
            OutMingChengValue(oWord, this.comboBox33.Text);

            OutMingCheng(oWord, "\n11、动脉搏动：");
            OutMingCheng(oWord, "\n   左上肢：");
            OutMingChengValue(oWord, this.comboBox35.Text);
            OutMingCheng(oWord, "触及：");
            OutMingChengValue(oWord, this.comboBox36.Text);
            OutMingCheng(oWord, "搏动");
            OutMingCheng(oWord, "\n   右上肢：");
            OutMingChengValue(oWord, this.comboBox37.Text);
            OutMingCheng(oWord, "触及：");
            OutMingChengValue(oWord, this.comboBox38.Text);
            OutMingCheng(oWord, "搏动");
            OutMingCheng(oWord, "\n   左下肢：");
            OutMingChengValue(oWord, this.comboBox39.Text);
            OutMingCheng(oWord, "触及：");
            OutMingChengValue(oWord, this.comboBox41.Text);
            OutMingCheng(oWord, "搏动");
            OutMingCheng(oWord, "\n   右下肢：");
            OutMingChengValue(oWord, this.comboBox40.Text);
            OutMingCheng(oWord, "触及：");
            OutMingChengValue(oWord, this.comboBox42.Text);
            OutMingCheng(oWord, "搏动");

            OutMingCheng(oWord, "\n12、血管杂音：");
            OutMingChengValue(oWord, txtXueGuan.Text);

            OutMingCheng(oWord, "\n13、其它情况：");
            OutMingChengValue(oWord, this.txtQiTa.Text);

            //第三页
            OutMingCheng(oWord, "\n静脉系统：");
            OutMingCheng(oWord, "\n1、肿胀：");
            OutMingChengValue(oWord, this.comboBox47.Text);
            OutMingCheng(oWord, "部位：");
            OutMingChengValue(oWord, this.comboBox46.Text);
            OutMingCheng(oWord, "上肢：");
            OutMingChengValue(oWord, this.comboBox45.Text);
            OutMingChengValue(oWord, this.comboBox44.Text);
            OutMingCheng(oWord, "下肢：");
            OutMingChengValue(oWord, this.comboBox43.Text);
            OutMingCheng(oWord, "性质：");
            OutMingChengValue(oWord, this.comboBox48.Text);
            OutMingCheng(oWord, "程度：");
            OutMingChengValue(oWord, this.comboBox49.Text);

            OutMingCheng(oWord, "\n2、紫绀：");
            OutMingChengValue(oWord, this.comboBox50.Text);
            OutMingChengValue(oWord, this.comboBox51.Text);
            OutMingCheng(oWord, "上肢：");
            OutMingChengValue(oWord, this.comboBox52.Text);
            OutMingChengValue(oWord, this.comboBox53.Text);
            OutMingCheng(oWord, "下肢：");
            OutMingChengValue(oWord, this.comboBox54.Text);

            OutMingCheng(oWord, "\n3、皮温：");
            OutMingChengValue(oWord, this.comboBox55.Text);

            OutMingCheng(oWord, "\n4、浅表静脉：");
            OutMingChengValue(oWord, this.comboBox56.Text);
            OutMingCheng(oWord, "部位：");
            OutMingChengValue(oWord, this.comboBox58.Text);
            OutMingCheng(oWord, "上肢：");
            OutMingChengValue(oWord, this.comboBox59.Text);
            OutMingChengValue(oWord, this.comboBox60.Text);
            OutMingCheng(oWord, "下肢：");
            OutMingChengValue(oWord, this.comboBox61.Text);

            OutMingCheng(oWord, "\n5、浅表静脉炎：");
            OutMingChengValue(oWord, this.comboBox57.Text);
            OutMingCheng(oWord, "部位：");
            OutMingChengValue(oWord, this.comboBox62.Text);
            OutMingCheng(oWord, "上肢：");
            OutMingChengValue(oWord, this.comboBox63.Text);
            OutMingChengValue(oWord, this.comboBox64.Text);
            OutMingCheng(oWord, "下肢：");
            OutMingChengValue(oWord, this.comboBox65.Text);

            OutMingCheng(oWord, "\n6、皮肤色素沉着：");
            OutMingChengValue(oWord, this.comboBox66.Text);
            OutMingCheng(oWord, "部位：");
            OutMingChengValue(oWord, this.comboBox67.Text);
            OutMingCheng(oWord, "下肢：");
            OutMingChengValue(oWord, this.comboBox68.Text);
            OutMingCheng(oWord, "程度：");
            OutMingChengValue(oWord, this.comboBox69.Text);

            OutMingCheng(oWord, "\n7、挤压痛：");
            OutMingChengValue(oWord, this.comboBox70.Text);
            OutMingCheng(oWord, "部位：");
            OutMingChengValue(oWord, this.comboBox71.Text);

            OutMingCheng(oWord, "\n8、周径：下肢膝关节远侧15cm，左：");
            OutMingChengValue(oWord, txtYuanZuo.Text);
            OutMingCheng(oWord, "cm，右：");
            OutMingChengValue(oWord, txtYuanYou.Text);
            OutMingCheng(oWord, "cm。下肢膝关节近侧20cm，左：");
            OutMingChengValue(oWord, txtJinZuo.Text);
            OutMingCheng(oWord, "cm，右：");
            OutMingChengValue(oWord, txtJinYou.Text);
            OutMingCheng(oWord, "cm。");

            OutMingCheng(oWord, "\n9、其它情况：");
            OutMingChengValue(oWord, txtQingKuang.Text);

            OutMingCheng(oWord, "\n10、其它系统：");
            OutMingChengValue(oWord, txtXiTong.Text);

            OutMingCheng(oWord, "\n11、关节：");
            OutMingChengValue(oWord, txtGuanJie.Text);

            OutMingCheng(oWord, "\n12、淋巴：");
            OutMingChengValue(oWord, txtLinBa.Text);

            //第四页
            OutMingCheng(oWord, "\n局部合并征：");
            OutMingCheng(oWord, "\n1、感染：部位：");
            OutMingChengValue(oWord, this.comboBox75.Text);
            OutMingCheng(oWord, "上肢：");
            OutMingChengValue(oWord, this.comboBox74.Text);
            OutMingChengValue(oWord, this.comboBox73.Text);
            OutMingCheng(oWord, "下肢：");
            OutMingChengValue(oWord, this.comboBox72.Text);
            OutMingCheng(oWord, "红肿炎性浸润程度：");
            OutMingChengValue(oWord, this.comboBox76.Text);
            OutMingCheng(oWord, "范围：");
            OutMingChengValue(oWord, this.comboBox77.Text);

            OutMingCheng(oWord, "\n2、坏疽：");
            OutMingChengValue(oWord, this.comboBox78.Text);
            OutMingCheng(oWord, "性质：");
            OutMingChengValue(oWord, this.comboBox79.Text);
            OutMingCheng(oWord, "部位左上肢：");
            OutMingChengValue(oWord, this.comboBox83.Text);
            OutMingCheng(oWord, "右上肢：");
            OutMingChengValue(oWord, this.comboBox80.Text);
            OutMingCheng(oWord, "左下肢：");
            OutMingChengValue(oWord, this.comboBox81.Text);
            OutMingCheng(oWord, "右下肢：");
            OutMingChengValue(oWord, this.comboBox84.Text);
            OutMingCheng(oWord, "界限：");
            OutMingChengValue(oWord, this.comboBox85.Text);

            OutMingCheng(oWord, "\n3、溃疡：");
            OutMingChengValue(oWord, this.comboBox86.Text);
            OutMingCheng(oWord, "部位：");
            OutMingChengValue(oWord, textBox24.Text);
            OutMingCheng(oWord, "面积：");
            OutMingChengValue(oWord, textBox25.Text);
            OutMingCheng(oWord, "形状：");
            OutMingChengValue(oWord, this.comboBox87.Text);
            OutMingCheng(oWord, "肉芽组织：");
            OutMingChengValue(oWord, this.comboBox88.Text);
            OutMingCheng(oWord, "上皮生长：");
            OutMingChengValue(oWord, this.comboBox89.Text);

            OutMingCheng(oWord, "\n4、分泌物：");
            OutMingChengValue(oWord, this.comboBox90.Text);
            OutMingCheng(oWord, "色泽：");
            OutMingChengValue(oWord, this.comboBox91.Text);
            OutMingCheng(oWord, "形态：");
            OutMingChengValue(oWord, this.comboBox92.Text);
            OutMingCheng(oWord, "气味：");
            OutMingChengValue(oWord, this.comboBox93.Text);
            OutMingCheng(oWord, "\n5、其它情况：");
            OutMingChengValue(oWord, txtJuBuQingKuan.Text);

            //第五页
            OutMingCheng(oWord, "\n专科检查：");
            OutMingCheng(oWord, "\n1、ABI指数：左");
            OutMingChengValue(oWord, txtABIZuo.Text);
            OutMingCheng(oWord, "右");
            OutMingChengValue(oWord, txtABIYou.Text);
            OutPic(oWord, oDoc, jpgFile1,  ABIPic.Image);

            OutMingCheng(oWord, "\n\n2、血管造影：");
            OutMingChengValue(oWord, cboXueGuan.Text);
            OutPic(oWord, oDoc, jpgFile2, picXueGuan.Image);
            OutMingCheng(oWord, "\n检查日期：");
            OutMingChengValue(oWord, dtXueGuanRiQi.Value.ToShortDateString());
            OutMingCheng(oWord, "检查号码：");
            OutMingChengValue(oWord, txtZaoYingHaoMa.Text);
            OutMingCheng(oWord, "\n其它：");
            OutMingChengValue(oWord, txtXueGuanQiTa.Text);

            OutMingCheng(oWord, "\n3、治疗方式：");
            OutMingChengValue(oWord, cboZhiLiao.Text);

            OutMingCheng(oWord, "\n4、手术或介入治疗时间及名称：");
            OutMingChengValue(oWord, txtShouShu.Text);

            OutMingCheng(oWord, "\n5、病情图片：");
            OutMingChengValue(oWord, cboBingQingTu.Text);
            OutPic(oWord, oDoc, jpgFile3, picBingQing.Image);

            OutMingCheng(oWord, "\n6、随访记录：");
            OutMingChengValue(oWord, txtSuiFang.Text);

            //end

            bool saveSuc = true;
            try
            {
                oDoc.SaveAs(ref docFile, ref missing, ref missing, ref missing,
                    ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
            }
            catch (Exception ex)
            {
                saveSuc = false;
            }
            if (saveSuc)
            {
                object oSaveOption = Word.WdSaveOptions.wdDoNotSaveChanges;
                oDoc.Close(ref oSaveOption, ref missing, ref missing);
                oWord.Application.Quit(ref oSaveOption, ref missing, ref missing);
                oDoc = null;
                oWord = null;
                ShellExecute(IntPtr.Zero, "open", docFile.ToString(), "", "", 3);
            }
            else
            {
                oDoc.PrintPreview();
            }
        }
        private void OutMingCheng(Word._Application oWord, string name)
        {
            object unite = Word.WdUnits.wdStory;
            object missing = System.Reflection.Missing.Value;
            oWord.Selection.EndKey(ref unite, ref missing);//移动光标至文末 
            oWord.Selection.Font.Underline = Microsoft.Office.Interop.Word.WdUnderline.wdUnderlineNone;
            oWord.Selection.TypeText(name);
        }
        private void OutMingChengValue(Word._Application oWord, string value)
        {
            value = "    " + value + "      ";
            object unite = Word.WdUnits.wdStory;
            object missing = System.Reflection.Missing.Value;
            oWord.Selection.EndKey(ref unite, ref missing);//移动光标至文末 
            oWord.Selection.Font.Underline = Microsoft.Office.Interop.Word.WdUnderline.wdUnderlineSingle;
            oWord.Selection.TypeText(value);
        }
        private void OutPic(Word._Application oWord, Word._Document oDoc, string picName, System.Drawing.Image image)
        {
            object olinkToFile = false;
            object oSaveWithDoc = true;
            object oAnchor = oWord.Selection.Range;
            this.OupPic(picName, image);
            oDoc.InlineShapes.AddPicture(picName, ref olinkToFile, ref oSaveWithDoc, ref oAnchor);
        }
        private void OupPic(string fileName, System.Drawing.Image image)
        {
            if (null != image)
            {
                image.Save(fileName);
            }

        }
        private void DelPic(string fileName)
        {
            System.IO.File.Delete(fileName);
        }
        private SearchManage _searchManage;

        private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            //if (comboBox2.SelectedIndex == 0)
            //{
            //    comboBox3.SelectedIndex = -1;
            //    comboBox4.SelectedIndex = -1;
            //    comboBox5.SelectedIndex = -1;
            //    comboBox6.SelectedIndex = -1;
            //}
        }

        private void comboBox7_SelectedIndexChanged(object sender, EventArgs e)
        {
            //if (comboBox7.SelectedIndex == 0)
            //{
            //    comboBox8.SelectedIndex = -1;
            //    comboBox9.SelectedIndex = -1;
            //    comboBox10.SelectedIndex = -1;
            //    comboBox11.SelectedIndex = -1;
            //}
        }

        private void comboBox12_SelectedIndexChanged(object sender, EventArgs e)
        {
            //if (comboBox12.SelectedIndex == 0)
            //{
            //    comboBox13.SelectedIndex = -1;
            //    comboBox14.SelectedIndex = -1;
            //    comboBox15.SelectedIndex = -1;
            //    comboBox16.SelectedIndex = -1;
            //}
        }

        private void comboBox17_SelectedIndexChanged(object sender, EventArgs e)
        {
            //if (comboBox17.SelectedIndex == 0)
            //{
            //    comboBox18.SelectedIndex = -1;
            //    comboBox19.SelectedIndex = -1;
            //    comboBox20.SelectedIndex = -1;
            //    comboBox21.SelectedIndex = -1;
            //}
        }

        private void comboBox22_SelectedIndexChanged(object sender, EventArgs e)
        {
            //if (comboBox22.SelectedIndex == 0)
            //{
            //    comboBox23.SelectedIndex = -1;
            //    comboBox24.SelectedIndex = -1;
            //    comboBox25.SelectedIndex = -1;
            //    comboBox26.SelectedIndex = -1;
            //}
        }

        private void comboBox47_SelectedIndexChanged(object sender, EventArgs e)
        {
            //if (comboBox47.SelectedIndex == 0)
            //{
            //    comboBox46.SelectedIndex = -1;
            //    comboBox45.SelectedIndex = -1;
            //    comboBox44.SelectedIndex = -1;
            //    comboBox43.SelectedIndex = -1;
            //}
        }

        private void comboBox50_SelectedIndexChanged(object sender, EventArgs e)
        {
            //if (comboBox50.SelectedIndex == 0)
            //{
            //    comboBox51.SelectedIndex = -1;
            //    comboBox52.SelectedIndex = -1;
            //    comboBox53.SelectedIndex = -1;
            //    comboBox54.SelectedIndex = -1;
            //}
        }

        private void comboBox56_SelectedIndexChanged(object sender, EventArgs e)
        {
            //if (comboBox56.SelectedIndex == 0)
            //{
            //    comboBox58.SelectedIndex = -1;
            //    comboBox59.SelectedIndex = -1;
            //    comboBox60.SelectedIndex = -1;
            //    comboBox61.SelectedIndex = -1;
            //}
        }

        private void comboBox57_SelectedIndexChanged(object sender, EventArgs e)
        {
            //if (comboBox57.SelectedIndex == 0)
            //{
            //    comboBox62.SelectedIndex = -1;
            //    comboBox63.SelectedIndex = -1;
            //    comboBox64.SelectedIndex = -1;
            //    comboBox65.SelectedIndex = -1;
            //}
        }

        private void comboBox66_SelectedIndexChanged(object sender, EventArgs e)
        {
            //if (comboBox66.SelectedIndex == 0)
            //{
            //    comboBox67.SelectedIndex = -1;
            //    comboBox68.SelectedIndex = -1;
            //    comboBox69.SelectedIndex = -1;
            //}
        }

        private void comboBox70_SelectedIndexChanged(object sender, EventArgs e)
        {
            //if (comboBox70.SelectedIndex == 0)
            //{
            //    comboBox71.SelectedIndex = -1;
            //}
        }

        private void comboBox78_SelectedIndexChanged(object sender, EventArgs e)
        {
            //if (comboBox78.SelectedIndex == 0)
            //{
            //    comboBox79.SelectedIndex = -1;
            //    comboBox80.SelectedIndex = -1;
            //    comboBox81.SelectedIndex = -1;
            //    comboBox83.SelectedIndex = -1;
            //    comboBox84.SelectedIndex = -1;
            //    comboBox85.SelectedIndex = -1;
            //}
        }

        private void comboBox86_SelectedIndexChanged(object sender, EventArgs e)
        {
            //if (comboBox86.SelectedIndex == 0)
            //{
            //    comboBox87.SelectedIndex = -1;
            //    comboBox88.SelectedIndex = -1;
            //    comboBox89.SelectedIndex = -1;
            //    textBox24.Text = "";
            //    textBox25.Text = "";
            //}
        }

        private void comboBox90_SelectedIndexChanged(object sender, EventArgs e)
        {
            //if (comboBox90.SelectedIndex == 0)
            //{
            //    comboBox91.SelectedIndex = -1;
            //    comboBox92.SelectedIndex = -1;
            //    comboBox93.SelectedIndex = -1;
            //}
        }

        private void btnxgzyin1_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.造影图片1 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.造影图片1.ToArray());
                    this.pictureBox1.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void btnxgzyopen1_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox1.Image);
        }

        private void btnxgzyin2_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.造影图片2 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.造影图片2.ToArray());
                    this.pictureBox2.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void btnxgzyopen2_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox2.Image);
        }

        private void btnxgzyin3_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.造影图片3 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.造影图片3.ToArray());
                    this.pictureBox3.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void btnxgzyopen3_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox3.Image);
        }

        private void btnxgzyin4_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.造影图片4 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.造影图片4.ToArray());
                    this.pictureBox4.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void btnxgzyopen4_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox4.Image);
        }

        private void button5_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.ABI图片1 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.ABI图片1.ToArray());
                    this.pictureBox7.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button7_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.ABI图片2 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.ABI图片2.ToArray());
                    this.pictureBox8.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button11_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.ABI图片3 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.ABI图片3.ToArray());
                    this.pictureBox10.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.病情图片1 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.病情图片1.ToArray());
                    this.pictureBox5.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.病情图片2 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.病情图片2.ToArray());
                    this.pictureBox6.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button9_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.病情图片3 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.病情图片3.ToArray());
                    this.pictureBox9.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button6_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox7.Image);
        }

        private void button8_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox8.Image);
        }

        private void button12_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox10.Image);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox5.Image);
        }

        private void button4_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox6.Image);
        }

        private void button10_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox9.Image);
        }

        private void button19_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.ABI图片4 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.ABI图片4.ToArray());
                    this.pictureBox14.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button21_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.ABI图片5 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.ABI图片5.ToArray());
                    this.pictureBox15.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button23_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.ABI图片6 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.ABI图片6.ToArray());
                    this.pictureBox16.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button24_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.ABI图片7 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.ABI图片7.ToArray());
                    this.pictureBox17.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button13_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.造影图片5 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.造影图片5.ToArray());
                    this.pictureBox11.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button15_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.造影图片6 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.造影图片6.ToArray());
                    this.pictureBox12.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button17_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.造影图片7 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.造影图片7.ToArray());
                    this.pictureBox13.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button45_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.造影图片8 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.造影图片8.ToArray());
                    this.pictureBox27.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button27_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.造影图片9 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.造影图片9.ToArray());
                    this.pictureBox18.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button47_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.造影图片10 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.造影图片10.ToArray());
                    this.pictureBox28.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button49_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.造影图片11 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.造影图片11.ToArray());
                    this.pictureBox29.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button29_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.病情图片4 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.病情图片4.ToArray());
                    this.pictureBox19.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button30_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.病情图片5 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.病情图片5.ToArray());
                    this.pictureBox20.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button31_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.病情图片6 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.病情图片6.ToArray());
                    this.pictureBox21.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button32_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.病情图片7 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.病情图片7.ToArray());
                    this.pictureBox22.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button37_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.病情图片8 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.病情图片8.ToArray());
                    this.pictureBox23.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button38_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.病情图片9 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.病情图片9.ToArray());
                    this.pictureBox24.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button39_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.病情图片10 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.病情图片10.ToArray());
                    this.pictureBox25.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button40_Click(object sender, EventArgs e)
        {
            try
            {
                string fileName = "";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    fileName = openFileDialog1.FileName;
                    _zhuanKe.病情图片11 = File.ReadAllBytes(fileName);
                    Stream stream = new MemoryStream(_zhuanKe.病情图片11.ToArray());
                    this.pictureBox26.Image = Image.FromStream(stream);
                }
            }
            catch (Exception ex)
            {
                GlobalBase.Global.Instance.ShowMessage(ex.Message);
                GlobalBase.CatchException.DealWithException(ex);
            }
        }

        private void button20_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox14.Image);
        }

        private void button22_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox15.Image);
        }

        private void button25_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox16.Image);
        }

        private void button26_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox17.Image);
        }

        private void button14_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox11.Image);
        }

        private void button16_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox12.Image);
        }

        private void button18_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox13.Image);
        }

        private void button46_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox27.Image);
        }

        private void button28_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox18.Image);
        }

        private void button48_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox28.Image);
        }

        private void button50_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox29.Image);
        }

        private void button33_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox19.Image);
        }

        private void button34_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox20.Image);
        }

        private void button35_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox21.Image);
        }

        private void button36_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox22.Image);
        }

        private void button41_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox23.Image);
        }

        private void button42_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox24.Image);
        }

        private void button43_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox25.Image);
        }

        private void button44_Click(object sender, EventArgs e)
        {
            ShowPic(this.pictureBox26.Image);
        }


    }
}
